<!-- eslint-disable vue/multi-word-component-names -->
<template>

<template v-for="(item, index) in homeroutes" :key="index">

 <el-menu-item v-if="!item.children?.length" :index="item.path">
      <el-icon>
        <component :is="item.meta.icon"/>
      </el-icon>
      <template #title>{{item.meta.name}}</template>
  </el-menu-item>

  <el-sub-menu :index="item.path" v-else>
    <template #title>
      <el-icon>
        <component :is="item.meta.icon" />
      </el-icon>
      <span>{{ item.meta.name }}</span>
    </template>
    <Menu :homeroutes="item.children">
    </Menu>
  </el-sub-menu>
  
 </template>
</template>
<script lang="ts" setup>
const { homeroutes } = defineProps(['homeroutes'])
import  Menu  from '@/components/Menu/Menu.vue';
</script>

